/**
 * Copyright (c) 2011-2014, homeant (homeanter@163.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package xin.homeant.upms.app.service.impl;

import java.io.Serializable;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.CachingSessionDAO;
import org.springframework.stereotype.Service;

import xin.homeant.cache.annotation.Cache;
import xin.homeant.cache.annotation.CacheDelete;
import xin.homeant.cache.annotation.CacheDeleteKey;
import xin.homeant.cache.type.CacheOpType;
import xin.homeant.upms.app.service.ISessionService;
import xin.homeant.upms.client.shiro.utils.SerializableUtil;

/**
 * <P>
 * TODO
 * </P>
 * 
 * @author homeant homeanter@163.com
 * @Data 2017年5月31日 下午1:47:42
 */
@Service
public class SessionServiceImpl implements ISessionService{

	@Override
	@Cache(expire = 18000, key = "'"+CachingSessionDAO.ACTIVE_SESSION_CACHE_NAME+"'",hfield="#args[0]",opType=CacheOpType.WRITE)
	public String put(Serializable id,String session) {
		return session;
	}

	@Override
	@CacheDelete(value = { @CacheDeleteKey(value = { "'"+CachingSessionDAO.ACTIVE_SESSION_CACHE_NAME+"'" },hfield="#args") })
	public void delete(String sessionId) {
		
	}

	@Override
	@Cache(expire = 18000, key = "'"+CachingSessionDAO.ACTIVE_SESSION_CACHE_NAME+"'",hfield="#args",opType=CacheOpType.READ_ONLY)
	public String get(Serializable sessionId) {
		return null;
	}

}
